// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [CrossNetworkAutomationService](super::stub::CrossNetworkAutomationService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct CrossNetworkAutomationService<T>
where
    T: super::stub::CrossNetworkAutomationService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> CrossNetworkAutomationService<T>
where
    T: super::stub::CrossNetworkAutomationService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::CrossNetworkAutomationService for CrossNetworkAutomationService<T>
where
    T: super::stub::CrossNetworkAutomationService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_service_connection_maps(
        &self,
        req: crate::model::ListServiceConnectionMapsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListServiceConnectionMapsResponse>> {
        self.inner.list_service_connection_maps(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_service_connection_map(
        &self,
        req: crate::model::GetServiceConnectionMapRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ServiceConnectionMap>> {
        self.inner.get_service_connection_map(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_service_connection_map(
        &self,
        req: crate::model::CreateServiceConnectionMapRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_service_connection_map(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_service_connection_map(
        &self,
        req: crate::model::UpdateServiceConnectionMapRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_service_connection_map(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_service_connection_map(
        &self,
        req: crate::model::DeleteServiceConnectionMapRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_service_connection_map(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_service_connection_policies(
        &self,
        req: crate::model::ListServiceConnectionPoliciesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListServiceConnectionPoliciesResponse>> {
        self.inner
            .list_service_connection_policies(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn get_service_connection_policy(
        &self,
        req: crate::model::GetServiceConnectionPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ServiceConnectionPolicy>> {
        self.inner.get_service_connection_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_service_connection_policy(
        &self,
        req: crate::model::CreateServiceConnectionPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .create_service_connection_policy(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn update_service_connection_policy(
        &self,
        req: crate::model::UpdateServiceConnectionPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .update_service_connection_policy(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn delete_service_connection_policy(
        &self,
        req: crate::model::DeleteServiceConnectionPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .delete_service_connection_policy(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_service_classes(
        &self,
        req: crate::model::ListServiceClassesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListServiceClassesResponse>> {
        self.inner.list_service_classes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_service_class(
        &self,
        req: crate::model::GetServiceClassRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ServiceClass>> {
        self.inner.get_service_class(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_service_class(
        &self,
        req: crate::model::UpdateServiceClassRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_service_class(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_service_class(
        &self,
        req: crate::model::DeleteServiceClassRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_service_class(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_service_connection_token(
        &self,
        req: crate::model::GetServiceConnectionTokenRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ServiceConnectionToken>> {
        self.inner.get_service_connection_token(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_service_connection_tokens(
        &self,
        req: crate::model::ListServiceConnectionTokensRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListServiceConnectionTokensResponse>> {
        self.inner
            .list_service_connection_tokens(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn create_service_connection_token(
        &self,
        req: crate::model::CreateServiceConnectionTokenRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .create_service_connection_token(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn delete_service_connection_token(
        &self,
        req: crate::model::DeleteServiceConnectionTokenRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .delete_service_connection_token(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}

/// Implements a [DataTransferService](super::stub::DataTransferService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct DataTransferService<T>
where
    T: super::stub::DataTransferService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> DataTransferService<T>
where
    T: super::stub::DataTransferService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::DataTransferService for DataTransferService<T>
where
    T: super::stub::DataTransferService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_multicloud_data_transfer_configs(
        &self,
        req: crate::model::ListMulticloudDataTransferConfigsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListMulticloudDataTransferConfigsResponse>>
    {
        self.inner
            .list_multicloud_data_transfer_configs(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn get_multicloud_data_transfer_config(
        &self,
        req: crate::model::GetMulticloudDataTransferConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::MulticloudDataTransferConfig>> {
        self.inner
            .get_multicloud_data_transfer_config(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn create_multicloud_data_transfer_config(
        &self,
        req: crate::model::CreateMulticloudDataTransferConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .create_multicloud_data_transfer_config(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn update_multicloud_data_transfer_config(
        &self,
        req: crate::model::UpdateMulticloudDataTransferConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .update_multicloud_data_transfer_config(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn delete_multicloud_data_transfer_config(
        &self,
        req: crate::model::DeleteMulticloudDataTransferConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .delete_multicloud_data_transfer_config(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_destinations(
        &self,
        req: crate::model::ListDestinationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListDestinationsResponse>> {
        self.inner.list_destinations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_destination(
        &self,
        req: crate::model::GetDestinationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Destination>> {
        self.inner.get_destination(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_destination(
        &self,
        req: crate::model::CreateDestinationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_destination(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_destination(
        &self,
        req: crate::model::UpdateDestinationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_destination(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_destination(
        &self,
        req: crate::model::DeleteDestinationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_destination(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_multicloud_data_transfer_supported_service(
        &self,
        req: crate::model::GetMulticloudDataTransferSupportedServiceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::MulticloudDataTransferSupportedService>> {
        self.inner
            .get_multicloud_data_transfer_supported_service(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_multicloud_data_transfer_supported_services(
        &self,
        req: crate::model::ListMulticloudDataTransferSupportedServicesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<
        gax::response::Response<crate::model::ListMulticloudDataTransferSupportedServicesResponse>,
    > {
        self.inner
            .list_multicloud_data_transfer_supported_services(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}

/// Implements a [HubService](super::stub::HubService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct HubService<T>
where
    T: super::stub::HubService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> HubService<T>
where
    T: super::stub::HubService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::HubService for HubService<T>
where
    T: super::stub::HubService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_hubs(
        &self,
        req: crate::model::ListHubsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListHubsResponse>> {
        self.inner.list_hubs(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_hub(
        &self,
        req: crate::model::GetHubRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Hub>> {
        self.inner.get_hub(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_hub(
        &self,
        req: crate::model::CreateHubRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_hub(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_hub(
        &self,
        req: crate::model::UpdateHubRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_hub(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_hub(
        &self,
        req: crate::model::DeleteHubRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_hub(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_hub_spokes(
        &self,
        req: crate::model::ListHubSpokesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListHubSpokesResponse>> {
        self.inner.list_hub_spokes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn query_hub_status(
        &self,
        req: crate::model::QueryHubStatusRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::QueryHubStatusResponse>> {
        self.inner.query_hub_status(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_spokes(
        &self,
        req: crate::model::ListSpokesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListSpokesResponse>> {
        self.inner.list_spokes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_spoke(
        &self,
        req: crate::model::GetSpokeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Spoke>> {
        self.inner.get_spoke(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_spoke(
        &self,
        req: crate::model::CreateSpokeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_spoke(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_spoke(
        &self,
        req: crate::model::UpdateSpokeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_spoke(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn reject_hub_spoke(
        &self,
        req: crate::model::RejectHubSpokeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.reject_hub_spoke(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn accept_hub_spoke(
        &self,
        req: crate::model::AcceptHubSpokeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.accept_hub_spoke(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn accept_spoke_update(
        &self,
        req: crate::model::AcceptSpokeUpdateRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.accept_spoke_update(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn reject_spoke_update(
        &self,
        req: crate::model::RejectSpokeUpdateRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.reject_spoke_update(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_spoke(
        &self,
        req: crate::model::DeleteSpokeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_spoke(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_route_table(
        &self,
        req: crate::model::GetRouteTableRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::RouteTable>> {
        self.inner.get_route_table(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_route(
        &self,
        req: crate::model::GetRouteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Route>> {
        self.inner.get_route(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_routes(
        &self,
        req: crate::model::ListRoutesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListRoutesResponse>> {
        self.inner.list_routes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_route_tables(
        &self,
        req: crate::model::ListRouteTablesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListRouteTablesResponse>> {
        self.inner.list_route_tables(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_group(
        &self,
        req: crate::model::GetGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Group>> {
        self.inner.get_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_groups(
        &self,
        req: crate::model::ListGroupsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListGroupsResponse>> {
        self.inner.list_groups(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_group(
        &self,
        req: crate::model::UpdateGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}

/// Implements a [InternalRangeService](super::stub::InternalRangeService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct InternalRangeService<T>
where
    T: super::stub::InternalRangeService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> InternalRangeService<T>
where
    T: super::stub::InternalRangeService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::InternalRangeService for InternalRangeService<T>
where
    T: super::stub::InternalRangeService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_internal_ranges(
        &self,
        req: crate::model::ListInternalRangesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListInternalRangesResponse>> {
        self.inner.list_internal_ranges(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_internal_range(
        &self,
        req: crate::model::GetInternalRangeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::InternalRange>> {
        self.inner.get_internal_range(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_internal_range(
        &self,
        req: crate::model::CreateInternalRangeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_internal_range(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_internal_range(
        &self,
        req: crate::model::UpdateInternalRangeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_internal_range(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_internal_range(
        &self,
        req: crate::model::DeleteInternalRangeRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_internal_range(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}

/// Implements a [PolicyBasedRoutingService](super::stub::PolicyBasedRoutingService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct PolicyBasedRoutingService<T>
where
    T: super::stub::PolicyBasedRoutingService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> PolicyBasedRoutingService<T>
where
    T: super::stub::PolicyBasedRoutingService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::PolicyBasedRoutingService for PolicyBasedRoutingService<T>
where
    T: super::stub::PolicyBasedRoutingService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_policy_based_routes(
        &self,
        req: crate::model::ListPolicyBasedRoutesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListPolicyBasedRoutesResponse>> {
        self.inner.list_policy_based_routes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_policy_based_route(
        &self,
        req: crate::model::GetPolicyBasedRouteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::PolicyBasedRoute>> {
        self.inner.get_policy_based_route(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_policy_based_route(
        &self,
        req: crate::model::CreatePolicyBasedRouteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_policy_based_route(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_policy_based_route(
        &self,
        req: crate::model::DeletePolicyBasedRouteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_policy_based_route(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}
